﻿using ControleRepresentante.Data.Catalogs;
using ControleRepresentante.Data.Helpers;

namespace ControleRepresentante.Data.CatalogSteps
{
    internal class CreateRepresentanteCatalogStep : CatalogStepBase<ControleRepresentanteCatalogStepTypes>
    {
        protected override ControleRepresentanteCatalogStepTypes CatalogStepType
        {
            get { return ControleRepresentanteCatalogStepTypes.CreateRepresentante; }
        }

        public override void Execute(IDataAccess dataAccess)
        {
            CatalogStepHelper catalogStepHelper = new CatalogStepHelper(dataAccess);

            catalogStepHelper
                .CreateTable("Representante")
                    .AddColumn("Nome", ColumnType.ShortString, false, true)
                    .AddColumn("Ativo", ColumnType.Boolean, false, false)
                    .AddColumn("UseJolitex", ColumnType.Boolean, false, false);

            catalogStepHelper
                .CreateTable("RepresentanteInfo")
                    .AddColumn("NomePedido", ColumnType.ShortString, false, false)
                    .AddColumn("InfoPedido", ColumnType.LongString, true, false);
        }
    }
}
